<template>
	<view class="flex flex-col items-center" @click="anchorIndex(val)">
		<view class="relative flex flex-col items-center">
			<view class="w-100 h-100 rounded-lg overflow-hidden border-2 border-solid border-[#BADEFF]">
				<ImageBoxVue :src="val.headimg" width="100rpx" height="100rpx"></ImageBoxVue>
			</view>
			<view
				class="bg-gradient-to-r z-10 from-[#D5CEFF] to-[#65B5FF] text-center absolute rounded-full py-2 px-4 -bottom-4">
				<text class="text-white text-[11rpx] whitespace-nowrap">{{jobQuery(val)}}</text>
			</view>
		</view>
		<text class="w-100 ellipsis mt-10">{{val.name}}</text>
		<text v-if="type" class="mt-10 f-s-18 c-999">实话实说</text>
	</view>
</template>

<script setup>
	import {
		jobQuery
	} from '@/config/publicFun';

	const {
		val,
		type
	} = defineProps(['val', 'type'])

	const anchorIndex = (item) => {
		const id = uni.getStorageSync('user').id
		const userid = item.id
		if (id != userid) {
			uni.navigateTo({
				url: `/pages/user/anchor?id=${item.id}`
			})
		}
	}
</script>

<style>

</style>